#include "Cloud.h"
void Cloud::Render()
{
	m_sStart.x=render_pos_.m_Position[0]+10;
	m_sEnd.x=render_pos_.m_Position[0]+stride_x-10;
	m_sStart.y=m_sEnd.y=render_pos_.m_Position[1]+stride_y/2;
//	printf("Cloud Rendering!(%d,%d)\n",stride_x,stride_y);
	RenderFrameDX9(this,Resource::instance().m_Cloud);
}
Cloud::Cloud()
{
	touch_type_=ITouchable::T_LINE;
	render_pos_.m_Texcoord[0]=0;
	render_pos_.m_Texcoord[1]=0;
	stride_x=112;
	stride_y=64;
}

Cloud::Cloud(CloudType _ct){
	touch_type_=ITouchable::T_LINE;
	render_pos_.m_Texcoord[0]=0;
	cloud_type_=_ct;
	switch (_ct)
	{
	case C_T1:
		render_pos_.m_Texcoord[1]=0;
		stride_x=112;
		stride_y=64;
		break;
	case C_T2:
		render_pos_.m_Texcoord[1]=64;
		stride_x=112;
		stride_y=64;
		break;
	case C_T3:
		render_pos_.m_Texcoord[1]=128;
		stride_x=208;
		stride_y=96;
		break;
	}
}

void Cloud::SetPosition(int _x,int _y)
{
	global_pos_.x=_x;
	global_pos_.y=_y;
}
